Skip to content

feat(app-shell, plugin-approvals): edit a record and its line tables in one save; a locked record locks its lines - #35755

Merged
objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/issue-35599-record-edit-save
Nov 20, 2026
Merged

objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/issue-35599-record-edit-save

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #35599
Part of #35590

Clause-②: no
Metadata-protocol: none

维护者速读

  • 有明细表的记录页:点「编辑」后主记录字段和明细行一起可改,点一次保存就一起写入;单字段就地编辑在所有记录页都保留,只保存主记录;两种编辑同一时间只开一种。
  • 属于「记录详情页重做」专题,替业务用户解决主记录和明细要分开改、分开存的问题;审批锁定中的记录,其明细行也一起锁住。
  • 保存被拒时什么都不写入,改动留在屏幕上,原因标在对应字段或明细行下;带着未保存的就地修改点「编辑」会先问是否放弃;出问题可直接撤回本次合并。
  • 无

What changes

Server, ruling A (settled, 「一起锁」). @objectstack/plugin-approvals binds a second lock hook, bindDetailRowLockHook, beside the existing record lock. While a master record is held by a locking pending approval (lockRecord not false), writes to its master_detail child rows are refused RECORD_LOCKED (409), with the same user sentence the record lock uses, naming the master by its object label:

  • beforeInsert reads the new row's FK; beforeUpdate and beforeDelete read previous[fk]. An update that moves the FK also checks the new master, so a reparent is checked at both ends.
  • Predicate (multi-row) writes are judged per row: the engine dispatches before-hooks per row with previous bound (ADR-0058 Addendum II), so any touched row under a locked master refuses the whole write.
  • When no row can be resolved (no previous, and the id read finds nothing), the write fails closed: it is refused if the master object has any locking request the writer's run does not own.
  • The existing exemptions carry over: session.isSystem, and the flow run that opened the approval (provenance.flowRunId === request.flow_run_id).
  • Lookup children are not locked, because ruling A names master-detail rows. sys_approval* masters are skipped.
  • recordHeldByLockingApproval now shares one private helper, lockingRequestsForRecords, with the new hook. Its own behaviour is unchanged.

Client, edit state (items 1-4, 6). On a record page that draws master-detail body tables, Edit now opens the page's edit state instead of the record form.

  • The record-level inline session enters, so the fields become inputs.
  • The page keeps its record:related_list nodes. While the edit state is open (and one batch can carry the tables), its controller provides @object-ui/plugin-detail's new RecordBodyTableEditorSlotContext: the edited relationship ids and a render function. The record:related_list renderer reads it first, and a list whose objectName.relationshipField id is in the set draws the host's editor in its place instead of the read-only list. No node type is registered for the editor. The editor is @object-ui/plugin-form's new RecordBodyTableEditor, built from MasterDetailForm's pieces: the LineItemsField grid, deriveDetail columns, applyColumnPermissions, and the relatedNew / relatedRowDelete add and remove rules.
  • The header's Edit slot holds Cancel and Save, pushed as two system action items through the existing header item list. The header layout is unchanged.
  • Save builds ONE POST /api/v1/batch with buildRecordEditBatch: op 0 is the record update (only the edited fields), followed by each table's buildMasterDetailEditBatch diff (create / dirty-fields update / delete). It is the same construction MasterDetailForm and LineItemsPanel persist through, reused without a fork, and MasterDetailForm.tsx is untouched.
  • On a refusal nothing lands, because the batch is one transaction. attributeRecordEditRefusal places each reason the server names on the record field, or on the line whose write carried that field, or on the table when several lines carry it. A reason with no field, such as a lock, becomes the summary line.
  • Cancel discards the record draft and the lines. The editors unmount and re-read their rows the next time Edit is pressed.
  • Unsaved edits register with the shell's existing leave guard (useRegisterUnsavedEdits, form.unsavedChanges).
  • The drawer renders the same RecordDetailView, so it gets the same edit state.

Ruling B (settled: 「全部保留」). Both edit modes stay, on every object, including objects with master-detail body tables. The provisional canEdit term that turned inline edit off on such pages is gone.

  • Per-field inline edit (pencil, double-click) saves the record alone through the save bar: one update, no batch.
  • Edit, then Save, saves the record and its body rows in one atomic batch (below).
  • Only one mode runs at a time:
    • (a) In the edit state no inline edit is offered. The edit state occupies the record's single inline session, so every field is already an input and no pencil is drawn, and the save bar is not mounted while the edit state is on. So no separate canEdit term is needed for this. Adding !recordEditState to the conjunction would in fact break the edit state: the controller enters the record-level inline session, and the provider refuses enter() when canEdit is false.
    • (b) Pressing Edit while an inline session holds unsaved changes asks first, in an AlertDialog (the components primitive, not window.confirm): Keep editing leaves the inline draft in place, Discard drops it and enters the edit state over the stored values. An inline session with no changes is ended and the edit state opens without a question.
  • On a page with body tables, Edit stays pressable during an inline session so that question can be asked. Every other page keeps greying Edit during an inline session, as before. Whether the page qualifies is state set during render, so the header's flag never lags a render.

Item 5 choice: option 2, UI-only. POST /api/v1/batch is a bulk surface, gated on bulk ∧ child for every object it writes. bodyTablesSaveTogether reads that gate from the objects' enable blocks the page already holds, through the spec's own canServeApiOperation. When the record lacks bulk ∧ update, or any table's child lacks bulk ∧ create/update/delete, the edit state still opens: the tables stay read-only with a notice saying why, and the record's own fields save through the plain update the inline session always used. Option 1 (auto-allow the batch path) would change batch-routes.ts or the enable rules, which is a REST contract change (Clause-② yes). Option 2 offers no edit the server would refuse and changes no contract.

Client half of ruling A. While approvalLocked, the page passes RelatedRecordActionsBridge a serve wrapper through the bridge's existing serve prop (withDetailWritesWithheld). The wrapper strips onCreate, onEdit and onDelete for master-detail children only. RelatedList.tsx and the bridge are not edited. The edit state never opens on a locked record, because the header draws no Edit there (objectstack#35593).

Tests

Server: ruling A through the real engine (plugin-approvals)

packages/plugins/plugin-approvals/src/detail-row-lock.integration.test.ts uses a real ObjectQL with the better-sqlite3 in-memory driver and the real hook:

  • insert, update and delete under a locked master are refused, each with a free-master CONTROL;
  • reparent into and out of a locked master is refused;
  • predicate update and delete (multi: true) are refused;
  • inside one transaction a refused row rolls the whole transaction back (the batch route's shape);
  • CONTROLs that still write: a system write, the opening run (a stranger run is refused), a lockRecord: false node, and a lookup child.

Each refusal asserts code RECORD_LOCKED, statusCode 409 and the userMessage sentence.

Readings:

  • detail-row-lock.integration.test.ts on the merged tree d0bdc9da, under the verify lock: Test Files 1 passed (1), Tests 10 passed (10). No plugin-approvals file changed after that commit; the head is 9cb0d100.
  • The whole plugin-approvals suite before the resume, on the branch at that time: Test Files 125 passed (125), Tests 1780 passed (1780).
  • pnpm --filter @objectstack/plugin-approvals typecheck exit 0 on d0bdc9da. That includes check:test-typecheck.
Server guard ablation (one-off, not committed)

Through scripts/ablation-replace.mjs on packages/plugins/plugin-approvals/src/lifecycle-hooks.ts:

  • The anchor const edges = masterEdgesOf(engine, object); was replaced by an empty edge list (anchor count 1 to 0, blob def2d354757a to 589ab177c306).
  • The suite imports the hook from source, so no build leg was needed.
  • Result: Tests 7 failed | 3 passed (10). Every refusal cell and the opening-run cell turned red. The three that stayed green are the controls that write anyway (system write, lockRecord: false, lookup child).
  • Restored: blob == HEAD (def2d354757a) and git diff HEAD is empty.
Client: the record page's edit state (app-shell harness, plugin-form, app-shell helpers)

RecordDetailView.harness.test.tsx block RecordDetailView.recordEditState-35599 renders the real record page at 1440 px on the app route:

  • ruling B 「全部保留」: on a page with body tables the Summary pencil opens inline edit with the tables untouched, and the save bar's Save sends one update of the record alone and no batch. Edit then opens the edit state, not the record form; there no pencil and no save bar are drawn, and the header shows Save and Cancel instead of Edit;
  • one mode at a time: with an unsaved inline change, Edit stays pressable and opens the discard dialog (the page's own, window.confirm never called). Keep editing keeps the draft and opens no edit state; Discard opens the edit state over the stored value, with no write;
  • CONTROL: an inline session with no changes is ended and Edit enters the edit state with no dialog;
  • one Save calls batchTransaction ONCE, and never update, create or delete, with op 0 {object: quote, action: update, id, data: {summary}} plus line create, line update (dirty field only), line delete and task update. That covers two body tables in one batch;
  • a refused batch (fields: [{field: product}]) keeps every edit (the field input, the edited quantity, the new line) and draws the reason under the line table on the new line (data-body-table-row-error="1"). Cancel then leaves the edit state with no second write, and re-entering shows the stored values;
  • item 5: a child without bulk keeps its table read-only with the notice, and the record saves through one update with no batch;
  • ruling A, client half: a locked record's two body tables draw no New, while the same page unlocked draws both (CONTROL).

RecordBodyTableEditor.recordEditBatch-35599.test.ts covers batch construction and owner tracing (a blank ghost line emits no op, a removed line is drawn nowhere) and refusal placement (on the record field, on a line, on the table, and as the summary). recordEditState.helpers-35599.test.ts covers the item-5 decision across bulk combinations, and the detail-only strip, with a lookup CONTROL.

On the head 9cb0d100, with --maxWorkers=1 --pool=forks under the verify lock, these five files gave Test Files 5 passed (5), Tests 141 passed (141):

  • RecordDetailView.harness.test.tsx, all 70 tests, the seven recordEditState-35599 cells among them;
  • recordEditState.helpers-35599.test.ts;
  • RecordBodyTableEditor.recordEditBatch-35599.test.ts;
  • scripts/__tests__/check-side-effects-array.test.ts;
  • scripts/__tests__/known-schema-types-derivation-5115.test.ts.

On the merged tree d0bdc9da, the three edit-state files plus packages/i18n/ gave Test Files 108 passed (108), Tests 2039 passed | 13 skipped (2052). That includes the zh-Hant generated-catalogue pin.

type-check exit 0 for @object-ui/app-shell and @object-ui/cli on 9cb0d100, and for @object-ui/plugin-form, @object-ui/i18n and @object-ui/app-shell on d0bdc9da.

Two one-off mutations, each restored with blob == HEAD and an empty git diff HEAD:

  • serve={approvalLocked → serve={false: the ruling-A client cell turned red (expected 2 to be +0).
  • Deleting the && !inlineEditOffForBodyTables term (provisional B, now retired): that cell turned red (expected 1 to be +0).
  • Ruling B 「全部保留」: setConfirmDiscard(true) swapped for enterNow() in the controller's requestEnter, through scripts/ablation-replace.mjs (anchor 1 to 0): the one-mode cell turned red (Tests 1 failed | 6 passed), and the restore was proved by blob == HEAD (b0b0e192465c) with an empty git diff HEAD.

Retired or migrated tests: the two swapBodyTablesForEditors cases in recordEditState.helpers-35599.test.ts are retired with the helper (see "Fixes after 9cb0d10"); record-related-list.editorSlot-35599.test.tsx pins the slot instead. The provisional ruling-B cell (a page drawing body tables offers no per-field inline edit; a page with none keeps it (CONTROL)) is retired, and the children: false fixture option it alone used goes with it. Its replacement is the three ruling-B cells above, in the same block. Nothing else existing was rewritten.

Acceptance notes

  • Files outside the claim's surface, each needed by this diff:
    • content/docs/permissions/system-context.mdx: check:system-context-census requires a keyed row for the new hook's isSystem exemption. bindDetailRowLockHook joins row 41 beside bindApprovalLockHook, and the generated register was rewritten with --write.
    • ui/packages/plugin-detail/src/renderers/record-related-list.tsx and relatedListCompact.ts: the editor slot (see "Fixes after 9cb0d10"). The original dispatch fenced record-related-list.tsx while 相关子表的页签:不放筛选排序,右上角只留「添加」和「在列表中打开」;批量添加要么全成要么全不成 #35601 is in flight; the follow-up fix order named that block file as the place for the slot check. The change is one import and one new wrapper component in front of the bound block. RelatedList.tsx is not edited.
    • zh-Hant.ts: regenerated from zh-Hans (gen:zh-hant).
    • ui/packages/plugin-form and ui/packages/i18n: for the reuse and the strings described above.
  • The erasure ratchet stays flat. The new previous-row read and the two test reads carry satisfies EngineQueryOptions, so lifecycle-hooks.ts stays at its ceiling of 4 and the test surface does not grow.
  • The record-page eligibility is written during render. setRecordEditEligible is called during render, not from an effect, because that point is below the view's early returns, where no hook may run. React re-renders before it commits, and the call does nothing once the value agrees.
  • Client gate (ruling A): done through the bridge's existing serve prop. RelatedList.tsx and the bridge are not edited.
  • Write-path coverage (A3): reported to the seat.

Fixes after 9cb0d10

Two CI reds at 9cb0d100 came from registering the body-table editor as a component type, record:body_table_editor: registered-types-validate-ratchet-10859 read 309 registered namespaced keys refused at type against its falling pin of 308, and exclusion-reason-truthfulness found the registration file was not imported there.

  • 216a0464 enters the edit state's two saves in the write census (affordanceGrantMap-12082.test.tsx): the record-alone update mapped to recordEdit, and the batch mapped to recordEdit, relatedNew, relatedRowDelete and editFormFields.
  • 59d1dbd8 stops making the editor a registered type. swapBodyTablesForEditors and BODY_TABLE_EDITOR_TYPE are removed, and the page keeps its record:related_list nodes. @object-ui/plugin-detail exports RecordBodyTableEditorSlotContext beside RecordBodyTablesContext, and RecordEditStateController provides it with the edited ids and a render function for RecordBodyTableEditor. The record:related_list renderer checks it before either binding. record-body-table-editor-renderer.tsx, its barrel import and both sideEffects entries are removed, and KNOWN_SCHEMA_TYPES, regenerated, is back to main's list. The changeset drops its @object-ui/cli line and names @object-ui/plugin-detail instead. The ratchet's pin was not raised, and no type was added to the authoring face.
  • 72de91f6 merges origin/main (K was 16; clean). The write census and the slot cell re-ran green on it (Tests 58 passed (58)).
  • e428aacf (L1-a R2): a supplied master-detail FK that is not a scalar id (an object such as { id }, or an array) no longer reads as "no master". It marks the write unresolved, which is refused while any record of that master object is held by a locking approval, on insert and on the new end of a reparent. The unresolved refusal now carries the same end-user sentence naming the master as the resolved one. New cell in detail-row-lock.integration.test.ts: an insert with { id: <locked master> } is refused and nothing lands (Tests 11 passed (11)). Ablation (the insert branch's unscalar check removed): Tests 1 failed | 10 passed. Restored, then the whole plugin-approvals suite: Test Files 125 passed (125), Tests 1784 passed (1784); typecheck exit 0.
Readings on 59d1dbd (verify lock, --maxWorkers=1)
  • registered-types-validate-ratchet-10859, exclusion-reason-truthfulness, check-side-effects-array, known-schema-types-derivation-5115: Test Files 4 passed (4), Tests 101 passed (101).
  • packages/plugin-detail/src/renderers/__tests__/record-related-list.* (8 existing files plus the new editorSlot-35599): Test Files 9 passed (9), Tests 59 passed (59).
  • RecordDetailView.harness.test.tsx and recordEditState.helpers-35599.test.ts: Test Files 2 passed (2), Tests 75 passed (75).
  • RecordBodyTableEditor.recordEditBatch-35599.test.ts and affordanceGrantMap-12082.test.tsx: Test Files 2 passed (2), Tests 60 passed (60).
  • type-check exit 0 for @object-ui/plugin-detail, @object-ui/plugin-form and @object-ui/app-shell. plugin-detail was rebuilt first, and its dist/index.d.ts names the new context.
  • Ablation through scripts/ablation-replace.mjs: slot.ids.has( was replaced by slot.ids.size < 0 && ( (anchor 1 to 0). Result: Tests 1 failed | 2 passed (3). The slot cell turned red and both CONTROLs stayed green. Restored: blob == HEAD (b8aa9e5da87d), git diff HEAD empty. The first attempt used a replacement that still contained the anchor; the tool refused it before running anything, so that attempt was a no-op.
  • Local gates, exit 0: check:nul-bytes, check:undeclared-dep-imports, check-sdui-manifest.mjs, check:test-source-alias, check:cross-package-test-inputs, check:platform-checklist and its --changed-from origin/main form, check-empty-changeset.mjs, check-changeset-no-major.mjs, check:issue-citations. This is a declared narrowing to the families that read the files this fix changes. CI runs the rest.

Browser reading (A4)

NOT MEASURED. A container restart killed the first run while it was building the dogfood server and console. The resumed run was limited to the affected test files, so no headless Chromium reading was taken and no screenshots exist. The record page's edit state, the discard dialog and the locked-rows gate are pinned only by the harness cells above.

Verification

Read these files first, ordered by risk:

  1. packages/plugins/plugin-approvals/src/lifecycle-hooks.ts, bindDetailRowLockHook. Check the fail-closed branch (no row resolvable) and the per-master exemption filter.
  2. ui/packages/app-shell/src/views/recordEditState.tsx, RecordEditStateController.save. Check how op 0 is dropped when the draft is empty, the update-vs-batch choice, and the refusal fan-out.
  3. ui/packages/app-shell/src/views/RecordDetailView.tsx and recordEditState.tsx's requestEnter. Check the header IIFE hunk (Cancel / Save, and Edit's disableDuringInlineEdit), the render-time setRecordEditEligible, and how enterNow ends an open inline session without reading that as leaving the edit state.

Two-minute check: from ui/, run pnpm exec vitest run packages/app-shell/src/views/RecordDetailView.harness.test.tsx -t recordEditState-35599. Expect Tests 7 passed.

Gates
  • Derived with node scripts/pm/dispatch-gates.mjs --commands: 121 families on the final tree.
  • All run locally, mostly on d0bdc9da. The 13 families the package.json edit added were run on 9cb0d100.
  • --ran reconciliation: 121 derived famil(ies) accounted for — 121 run, 0 NOT-MEASURED.
  • Non-zero exits:
    • pnpm --dir ui exec vitest run scripts/ exit 1 on d0bdc9da. Four failures came from this diff: the editor registration was outside the sideEffects chain, and KNOWN_SCHEMA_TYPES was stale. Both are fixed in 9cb0d100, and the two files re-ran green there (above).
    • pnpm check:query-options-erasure and pnpm check:system-context-census were red on the previous run's tree, from this diff's server half. Both were fixed, and both are green on the final run.
    • NOT MEASURED, prerequisite missing in this box (CI builds it): check:dts-closure (exit 1, no dist for unbuilt packages such as plugins/organizations), check:dual-build-cjs-loads (exit 3), and @objectstack/spec check:skill-examples (exit 3, client-react not built).
    • NOT MEASURED: check-plugin-teardown-shape.mjs --self-test (exit 3). This checkout is shallow, and the gate's fixture commit is out of reach.
  • node scripts/check-sdui-manifest.mjs exit 0 on 9cb0d100. The byte comparison against a regenerated manifest is CI's (Build & E2E UI).
  • node scripts/check-platform-checklist.mjs --changed-from origin/main: OK — … 4 anchor(s) judged, 0 lost.
  • check:nul-bytes exit 0.
  • CI runs the full battery. Its check-runs are not cited here, because they had not concluded when this was written.

… tables in one batch

Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
Co-authored-by: Claude <noreply@anthropic.com>
…ave, refusal placement, rulings A and B

The body-table editor reads its adapter from the record context, as the
page's related lists do: the schema context is not mounted on every host.

Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
Co-authored-by: Claude <noreply@anthropic.com>
…-save item; changeset

Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
Co-authored-by: Claude <noreply@anthropic.com>
…ineItemsPanel does

Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
Co-authored-by: Claude <noreply@anthropic.com>
… mode at a time

Inline edit stays on pages that draw body tables and saves the record alone
through the save bar; Edit there enters the edit state, which saves the record
and its lines in one batch. The edit state occupies the record's single inline
session, so no per-field inline edit is offered inside it, and Edit over unsaved
inline changes asks to discard them first (an AlertDialog). The Edit button's
eligibility is state set during render, so its disabled flag never lags.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
…ish fallbacks for its strings

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
…; regenerated zh-Hant

The detail-row lock's previous-row read and its test reads carry the declared
EngineQueryOptions type instead of an erasing cast, so the erasure ratchet
holds. The system-context census lists bindDetailRowLockHook beside the record
lock it extends. zh-Hant is regenerated from zh-Hans.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
… mutable context arrays

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
…ule the barrel keeps

record:body_table_editor registered at load time inside recordEditState.tsx,
which no sideEffects-covered chain reaches from the barrel, so a bundler could
shake the registration away. It moves to record-body-table-editor-renderer.tsx,
imported from the barrel and listed in sideEffects like the other record
renderers; recordEditState.tsx imports it too. KNOWN_SCHEMA_TYPES is
regenerated to include the type.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
@github-actions github-actions Bot added size/xl dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-approvals, touching 11 documentable anchor(s).

47 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 0e2de25149ec81ecb00094300ad2f1e506ddc1fd.

⛔ 9 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: master_detail (literal, 46 pages)
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 0e2de25149ec81ecb00094300ad2f1e506ddc1fd → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 09dcae50da66f5f3f33d387dd97fe7ab607dcbf7 — the merge of head e428aacfe2fceaf55b1ea324dabf01c26d4aa853 into base 0e2de25149ec81ecb00094300ad2f1e506ddc1fd, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 09dcae50da66f5f3f33d387dd97fe7ab607dcbf7 && git checkout 09dcae50da66f5f3f33d387dd97fe7ab607dcbf7
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0e2de25149ec81ecb00094300ad2f1e506ddc1fd e428aacfe2fceaf55b1ea324dabf01c26d4aa853 && git checkout -B drift-repro 0e2de25149ec81ecb00094300ad2f1e506ddc1fd && git merge --no-ff e428aacfe2fceaf55b1ea324dabf01c26d4aa853

node scripts/docs-audit/affected-docs.mjs --json 0e2de25149ec81ecb00094300ad2f1e506ddc1fd

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 0e2de25149ec81ecb00094300ad2f1e506ddc1fd → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…te census

The edit state's Save writes the record alone (update) or the record and
its body tables as one batch; both sites were unlisted. Map the update
behind recordEdit (the page) and the batch behind recordEdit, relatedNew,
relatedRowDelete (the body-table editor) and editFormFields (the field
write gate's edit columns).

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
…ot, not a registered node type

The edit state rewrote each body-table `record:related_list` node into a
`record:body_table_editor` node registered through ComponentRegistry, which
grew `objectui validate`'s namespaced-at-type count past its falling pin and
put an internal node into the known schema types. The page now keeps its
`record:related_list` nodes: the edit state's controller provides
plugin-detail's new `RecordBodyTableEditorSlotContext` (the edited ids and a
render function), and the related-list renderer draws the host's
`RecordBodyTableEditor` in place of a list whose id is in the set.

The registration module, its barrel import and sideEffects entries are gone;
KNOWN_SCHEMA_TYPES is regenerated back to main's list; the swap helper and its
unit cases are retired, replaced by a renderer pin with two CONTROLs.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 记录在审批中被锁定时,它的明细行(主从子表的行)也一起锁住:新增、修改、删除都会被服务器拒绝,界面上也不再给出这些按钮;把一行从别的记录挪进来或挪出去同样被拒。
  • 记录详情页点「编辑」后,记录本身和它的明细表一起编辑,点「保存」一次性提交,全成或全不成;出错时提示落在对应的字段或那一行上。
  • 按您的裁定,逐字段的就地编辑在所有对象上都保留,只保存记录本身;两种编辑不会同时出现,就地编辑有未保存的修改时点「编辑」会先弹窗确认。
  • 豁免和原来的记录锁一致:系统写入和发起这次审批的流程本身不受限;判断不出影响哪些行的批量写入一律拒绝。
  • 席位意见:通过,分区自己合并;合并前补一份认领范围说明,并在服务器检查里补一处收紧(关联值不是普通编号时也按拒绝处理),我再做一次短复核。

席位核对

ACCEPT · head 72de91f60f · Fixes #35599, Part of #35590 (maintainer direct dispatch; ruling A 「一起锁」, ruling B 「全部保留」 7030366929) · K=1 · merge-tree vs origin/main clean · governed 0/30 · +2067/−16, 30 files (2083 ≤ 3000) · CI 61 success, 9 skipped · 2026-11-20T06:27Z

Routing: seat ruled no L2 (no packages/spec face, the guard reuses RECORD_LOCKED); Clause-②: no, not governed, under 3000 lines → the area lands it after R1, R2 and my short delta.

Server guard (bindDetailRowLockHook), read closely as the seat asked:

  • Edges: every master_detail field of the written object (reference, else the rejected referenceTo alias), resolved at write time from the registry; approval bookkeeping objects skipped on both sides. A junction with two masters is held by either.
  • Masters touched: insert → each FK on the new row (the engine dispatches beforeInsert per row, engine-insert.ts ~674, so a multi-row insert is judged row by row); update → previous's FK AND the new FK when the payload sets it and it differs (reparent checked at both ends); delete → previous's FK. A single-id dispatch without a pre-image reads the FK columns as SYSTEM; anything still unnamed is unresolved and refused when any record of that master object is held by a locking request, excluding the exempt run. Fail-closed as described.
  • Exemptions: session.isSystem and provenance.flowRunId == pending.flow_run_id, the same two as bindApprovalLockHook; no admin bypass; the status-mirror exemption rightly has no analogue. A no-op update (only id / updated_at) passes, as in the record lock.
  • One judgement: recordHeldByLockingApproval and the new hook share lockingRequestsForRecords, so "held" cannot disagree between read and write.
  • Refusal: the record lock's end-user sentence naming the MASTER, no title (deny path reads no master row). Priority 50 on all three events.
  • Integration cells (10): insert/update/delete each with a free-master CONTROL, reparent both ends, predicate write, atomic batch rollback, system exempt, opening run exempt vs another run, lockRecord: false, lookup child not held. Ablation 7 red per the report.

Client:

  • save: draft-only → the plain dataSource.update the inline session always used; with tables → one runBatchTransaction(ops), op 0 the master update (dropped when the draft is empty); refusals mapped back by owners (field / row / table). bodyTablesSaveTogether admits the tables only when the parent and every child serve bulk create/update/delete; otherwise they stay read-only with a notice.
  • Ruling B: the edit state takes the one inline session (no pencils, no save bar); Edit with unsaved inline changes opens an AlertDialog (ablation red per the report). The editor is drawn through RecordBodyTableEditorSlotContext, not a registered type, so KNOWN_SCHEMA_TYPES equals main.

Required before landing:

  • R1 (claim amendment, text only). Outside claim 7029471192's surface: packages/plugins/plugin-approvals/src/approvals-plugin.ts (the bind line), content/docs/permissions/system-context.mdx, ui/packages/app-shell/src/views/recordEditState.tsx + recordEditState.helpers-35599.test.ts (new), ui/packages/plugin-form/src/RecordBodyTableEditor.tsx + its test, formChrome.ts, plugin-form/src/index.tsx, affordanceGrantMap-12082.test.tsx, the 11 i18n packs (3 new keys each), and plugin-detail/src/index.tsx, relatedListCompact.ts, renderers/record-related-list.tsx + record-related-list.editorSlot-35599.test.tsx. The last group was ⛔ in the claim for 相关子表的页签:不放筛选排序,右上角只留「添加」和「在列表中打开」;批量添加要么全成要么全不成 #35601's sake; fix(record-page): the related tab offers only open-in-list and one add entry; a multi-pick add is all or none #35725 merged at 05:56Z, so the reason is gone, but the amendment must say so.
  • R2 (guard hardening, push + one pin). scalarFk turns a present, non-empty, non-scalar FK value (an object such as { id }, or an array) into null, and the hook then judges no master for it: on insert and on the new end of a reparent the guard is silent. The referential-integrity check also skips object values (engine-referential-integrity.ts ~312). Whether any later step unwraps such a value into a real id is not shown here, and a guard should not depend on it. Treat a supplied FK that is non-empty but not a scalar as unresolved (fail closed, as the predicate path already does) and pin it with one cell (insert under a locked master with { id: <master> } refused).

Recommended (not blocking):

  • A4 browser reading is NOT MEASURED. One run of Edit → change a line → Save on a record with a body table, and one locked record showing no New / Edit / Delete on its lines, would cover the new surface; attach to the PR.

Nits (no action required):

  • runBatchTransaction falls back to the sequential emulation on an adapter with no native batch; the console adapter is native and atomic on our server, so "all or none" holds in the product. The changeset's "one atomic batch" is true for that adapter only.
  • Every detail-object write now makes one pending-request lookup per touched master, on top of the record lock's own; a large line import under one master pays it per row. Watch, no action.

A supplied master-detail FK that is not a scalar id (an object such as
`{ id }`, or an array) read as no master, so the detail-row lock was
silent on insert and on the new end of a reparent. Such a value now marks
the write unresolved and is refused while any record of that master object
is held by a locking approval. The unresolved refusal now carries the same
end-user sentence naming the master as the resolved one.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 按上次的要求补了服务器检查的一处收紧:新增或挪动明细行时,如果关联值不是一个普通编号,只要该类记录中有被审批锁定的,就按拒绝处理。
  • 这类拒绝现在也给用户一句看得懂的话,说明是哪类记录被锁定,和其他锁定提示一致。
  • 认领范围说明已补齐,包括原先划给另一项改动、那项合并后已解除的文件。
  • 新增一个测试场景证明这种写法会被拒绝且什么都没写进去。
  • 席位意见:通过,等自动检查全绿后分区合并。

席位核对

delta ACCEPT (on ACCEPT 7032276125) · head e428aacfe2 (one commit on 72de91f60f) · K=1 · merge-tree vs origin/main clean · delta +33/−8, 2 files · CI 10 success, 11 skipped, 20 in progress · 2026-11-20T06:33Z

R (CI). 20 checks were running at this head. Land on all green.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Landing · area ux-2 · 2026-11-20T06:57Z

reading value
L1-a ACCEPT comment 7032276125 at 72de91f60f; delta ACCEPT 7032383142 at head e428aacfe2 (= current head)
Seat no L2 owed (no contract face; the guard reuses RECORD_LOCKED); rulings A 「一起锁」 and B 「全部保留」 recorded on #35599
CI green at e428aacfe2 (63 success, 11 skipped, 0 failed); K = 2 (< 15)
check-governed-merges --pr 35755 NOT governed; +2092 / −16 ≤ 3000

State: draft → ready + auto-merge (merge queue). Fixes #35599; #35590 stays open.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 20, 2026 06:58
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 44691577418 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (10/10) — 失败步骤: Run this shard's tests

    @objectstack/example-showcase:test:  FAIL  test/paid-invoice-line-lock.test.ts > a paid invoice's lines are locked against adding, removing and moving > removing a line from a paid header is refused, 
      ↳ 失败原因: @objectstack/example-showcase:test: AssertionError: expected undefined to be 'This invoice is paid, so its lines ar…' // Object.is equality
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • test/paid-invoice-line-lock.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 18 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Re-queue · area ux-2 · 2026-11-20T07:20Z

Queue run 44691577418 ejected this PR on examples/app-showcase/test/paid-invoice-line-lock.test.ts (Test Core 10/10). This PR does not reach it:

  • That test boots a bare ObjectQL with the showcase's own sandboxed hooks only: no approvals plugin, no UI. This PR's server change is in plugin-approvals, and the rest of the diff is UI and docs. Nothing in objectql, runtime or the showcase is touched.
  • The refusal arrived as a SandboxError with no innerMessage. The sandbox leaves that field empty only for its own internal errors (a hook timeout, a marshalling failure), never for a hook's thrown business sentence. That reads as load on a full queue build, not a behaviour change.
  • On this head (e428aacfe2), pnpm exec vitest run test/paid-invoice-line-lock.test.ts in examples/app-showcase passes, Tests 12 passed (12) under the verify lock.

Head unchanged, with both L1-a ACCEPTs (7032276125, 7032383142) and green PR CI, so auto-merge is re-armed once. A second ejection on the same signature goes to triage, not to another re-queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

记录页编辑:主记录的字段和主从子表的行一起进入编辑状态,一次保存、同一个事务

2 participants